package lowlevelcv

import (
	"dustbe/util"
	"fmt"
	"os"
	"runtime"
)

var (
	cpplib     string = "cpplib"
	cachePath  string = "./data/cache"
	cohPath    string
	dehazePath string
)

func init() {
	switch runtime.GOOS {
	case "windows":
		{
			cohPath = cpplib + "/coh.exe"
			dehazePath = cpplib + "/dehaze.exe"
		}
	case "linux":
		{
			cohPath = cpplib + "/coh"
			dehazePath = cpplib + "/dehaze"
		}
	}

	cohPathExist, _ := util.CheckFilePath(cohPath)
	dehazePathExist, _ := util.CheckFilePath(dehazePath)

	if !util.Debug && !cohPathExist {
		fmt.Printf("model file %s doesn't exist!\n", cohPath)
		os.Exit(-1)
	}
	if !util.Debug && !dehazePathExist {
		fmt.Printf("model file %s doesn't exist!\n", dehazePath)
		os.Exit(-1)
	}
}
